function createNode(x, y, w, h, image, text) {
	var node = new JTopo.Node(text);
	node.setLocation(x, y);
	node.setSize(w, h);
	if (image != null) {
		// console.log(">>>"+image);
		node.setImage(image);
	}

	node.borderRadius = 10; // 圆角
	node.borderWidth = 2; // 边框的宽度
	node.borderColor = '102,102,102';
	node.textPosition = 'Bottom_Center';
	node.fontColor = '0,0,0';
	node.fillColor = '102,102,102';

	return node;
}

function createNode2(x, y, w, h, image, text) {
	var node = new JTopo.Node(text);
	node.setLocation(x, y);
	node.setSize(w, h);
	if (image != null) {
		// console.log(">>>"+image);
		node.setImage(image);
	}

	node.zIndex = 10;
	node.borderRadius = 10; // 圆角
	node.textPosition = 'Bottom_Center';
	node.fontColor = '0,0,0';
	node.fillColor = '0,150,0';
	return node;
}

// 折线
function foldLink(nodeA, nodeZ, text, direction, dashedPattern, color) {
	var link = new JTopo.FoldLink(nodeA, nodeZ, text);
	link.direction = direction || 'horizontal';
	// link.arrowsRadius = 10; // 箭头大小
	link.lineWidth = 3; // 线宽
	link.bundleOffset = 60; // 折线拐角处的长度
	link.bundleGap = 20; // 线条之间的间隔
	link.textOffsetY = 3; // 文本偏移量（向下3个像素）
	if (color != null) {
		link.strokeColor = color;// 线条颜色随机
	} else {
		link.strokeColor = '102,102,102';// 线条颜色随机
	}
	link.dashedPattern = dashedPattern;
	link.fontColor = '0,0,0';
	return link;
}

function strikeLink(nodeA, nodeZ, text, direction, dashedPattern, color) {
	var link = new JTopo.Link(nodeA, nodeZ, text);
	link.direction = direction || 'horizontal';
	link.lineWidth = 3; // 线宽
	link.textOffsetY = 2; // 文本偏移量（向下3个像素）
	if (color != null) {
		link.strokeColor = color;// 线条颜色随机
	} else {
		link.strokeColor = '102,102,102';// 线条颜色随机
	}

	link.dashedPattern = dashedPattern;
	link.fontColor = '0,0,0';
	link.zIndex = 1;
	return link;
}

function createContainer(x, y, w, h) {
	var node = new JTopo.Node();
	node.setBound(x, y, w, h);
	node.fontColor = '0,0,0';
	node.alpha = 0.1;
	node.fillColor = '200,200,200';
	node.borderColor = '0,0,0';
	node.borderWidth = 1;
	node.zIndex = 0;
	return node;
}

function createTextNode(x, y, text) {
	var textNode = new JTopo.TextNode(text);
	textNode.font = 'bold 16px 微软雅黑';
	textNode.setLocation(x, y);
	textNode.fontColor = '0,0,0';
	return textNode;
}